const koa = require('koa')
const axios = require('axios')
const app = new koa()
const midd1 =async (ctx, next) => {
  ctx.message = 'aaa',
  await next()
  res.end(ctx.message)
}
const midd2 =async (ctx, next) => {
  ctx.message += 'bbb',
  await next()
}
const midd3 =async (ctx, next) => {
  // ctx.message += 'ccc'
  // axios.get('http://123.207.32.32.9001/lyric?id=167876').then(res => {
  //   res.message += res.data.lrc.lyric
  // })
  const res = await axios.get('http://123.207.32.32.9001/lyric?id=167876')
  res.message += res.data.lrc.lyric
}
app.use(midd1)
app.use(midd2)
app.use(midd3)
app.listen(9091, () => {
  console.log('koa 实现异步数据')
})